package trainfengxing.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Update;
import trainfengxing.pojo.train;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import trainfengxing.pojo.user;

import java.util.List;

/**
 * 部门管理
 */
@Mapper
public interface trainMapper {
    @Select("select * from trains")
    List<train> seat();

    @Select("select * from users")
    List<user> userlogin();

    List<train> selecttrain(train train);

    //删除车次
    @Delete("delete from trains where seatID = #{seatID}")
    void deletetrain(train train);



    @Update("UPDATE trains SET `starting`=#{starting},`terminal`=#{terminal},`departure`=#{departure},`arrival`=#{arrival},`price`=#{price},`seatType`=#{seatType} WHERE seatID = #{seatID}")
    void updatetrain(train train);
}
